#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
#define NUM 4//拼图长宽
#define RANDTIME 10//打乱次数
#define VOLUME 10
void paintEvent(QPaintEvent *);
bool ifWin();
void keyPressEvent(QKeyEvent *event);
void CreatNewGame();
void timerEvent(QTimerEvent *);

private:
    Ui::Widget *ui;
    int Game[NUM][NUM];
    void init();
    void GoUp();
    void GoDown();
    void GoLeft();
    void GoRight();
};
#endif // WIDGET_H
